package com.alipay.mapper;

import com.alipay.model.entity.RedBagTransEntity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *
 * @author Jun
 * @date 2019/3/23
 */
@Repository
public interface RedBagTransMapper {

    /**
     * 抢红包记录入库
     * @param redBagTransEntity
     * @return
     */
    int insert(RedBagTransEntity redBagTransEntity);

    /**
     * 更新红包到账状态
     * @param redBagNo
     * @param userId
     * @param newStatus
     * @return
     */
    int updateStatus(String redBagNo, String userId, Byte newStatus);

    /**
     * 更新红包到账状态
     * @param redBagNo
     * @param userId
     * @param oldStatus
     * @param newStatus
     * @return
     */
    int updateStatus(String redBagNo, String userId,Byte oldStatus, Byte newStatus);

    /**
     * 获取红包记录
     * @param redBagNo
     * @return
     */
    List<RedBagTransEntity> queryRedBagTransInfo(String redBagNo);

    /**
     * 获取转账失败的红包记录
     * @param redBagTransEntity
     * @param limit
     * @return
     */
    List<RedBagTransEntity> queryRedBagTransInfo(RedBagTransEntity redBagTransEntity, Integer limit);

    /**
     * 获取转账失败的红包记录
     * @param redBagTransEntity
     * @param lastId
     * @param limit
     * @return
     */
    List<RedBagTransEntity> queryRedBagTransInfo(RedBagTransEntity redBagTransEntity, Long lastId, Integer limit);
}
